const state = {
    // userInfo: {},
    userNum: {},
    phone: '',
    avatar: '',
    friendUserId: ''
}
const getters = {}
const mutations = {
    SET_USERINFO: (state, info) => {
        console.log('首页请求个人信息的接口并存到store', info)
        state.userInfo = info
    },
    SET_USER_NUM: (state, info) => {
        state.userNum = info
    },
    UPDATE_PHONE(state, phone) {
        state.phone = phone;
    },
    UPDATE_AVATAR(state, avatar) {
        state.avatar = avatar
    },
    UPDATE_FRIEND_USER_ID(state, friendUserId) {
        state.friendUserId = friendUserId
    }
}

const actions = {
    setUserInfo({commit}, item) {
        commit('SET_USERINFO', item)
    },
    setUserNum({commit}, item) {
        commit('SET_USER_NUM', item)
    },
}

export default {
    namespaced: true,
    state,
    actions,
    getters,
    mutations
}